<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/main-layout.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="title">
        <h:outputText value="#{msg.report_age_title}"></h:outputText>
    </ui:define>
    <ui:define name="content">
        <h:panelGroup id="messagePanel" layout="block">
            <h:messages globalOnly="true" errorStyle="color: red" infoStyle="color: green" />
        </h:panelGroup>
        <h4>#{msg.report_age_header}</h4>
        <h:form>
            <h:panelGrid columns="3">
                <h:outputLabel value="#{msg.parent_id_label}" for="parentId" />
                <h:selectOneMenu styleClass="formSelect" id="parentId" value="#{report.parentId}"
                                 title="#{msg.parentid_label}" required="true"
                                 converterMessage="#{msg.required_parentid_message}">
                    <f:selectItem itemValue="NULL" itemLabel="--Select--" />
                    <f:selectItems value="#{formList.parentIDs}" />
                </h:selectOneMenu>
                <h:message for="parentId"  errorStyle="color: red" />
                <h:outputLabel styleClass="formLabel" value="#{msg.start_date_label}" for="startDate" />
                <p:calendar id="startDate" value="#{report.startDate}" title="#{msg.start_date_label}"
                            required="true" requiredMessage="#{msg.start_date_required_message}"
                            mode="popup" navigator="true" pattern="dd/MM/yyyy">
                </p:calendar>
                <h:message for="startDate"  errorStyle="color: red" />
                <h:outputLabel styleClass="formLabel" value="#{msg.stop_date_label}" for="stopDate" />
                <p:calendar id="stopDate" value="#{report.stopDate}" title="#{msg.stop_date_label}"
                            required="true" requiredMessage="#{msg.stop_date_required_message}"
                            mode="popup" navigator="true" pattern="dd/MM/yyyy">
                </p:calendar>
                <h:message for="stopDate"  errorStyle="color: red" />
            </h:panelGrid>
            <h:commandButton styleClass="formButton" action="#{home.mainMenu}" value="#{msg.home_button_label}" immediate="true" />
            <h:commandButton styleClass="formButton" action="#{report.createReportByParent}" value="#{msg.generate_report_label}" />
        </h:form>
    </ui:define>
</ui:composition>